<?php

declare(strict_types=1);

namespace App\Model;


/**
 * @property int $receive_user_id 男用户id
 * @property int $send_user_id 女用户id
 * @property int $type 1一键搭讪  2手动搭讪  3红线  4主页私信  5上线私信
 * @property string $create_time
 */
class UserFirstAccost extends Model
{
    /**
     * The table associated with the model.
     */
    protected ?string $table = 'tb_user_first_accost';

    /**
     * The attributes that are mass assignable.
     */
    protected array $fillable = [];

    /**
     * The attributes that should be cast to native types.
     */
    protected array $casts = ['receive_user_id' => 'integer', 'send_user_id' => 'integer', 'type' => 'integer'];

    /**
     * Note - 记录女用户对男用户发消息
     * DateTime 2024/7/31 14:37
     * User Admin
     * @param mixed $uid
     * @param mixed $user_id
     * @param int $type
     */
    public function recordFirstAccost(mixed $uid, mixed $user_id, int $type)
    {
        $data = [
            'receive_user_id' => $uid,
            'send_user_id' => $user_id,
            'type' => $type,
        ];
        $this->query()->insertOrIgnore($data);
    }

}
